﻿using System;
using System.Collections.Generic;

namespace Ewk.MachineLearning.Clustering.MultidimensionalScaling
{
    public class EntityDifference<T>
        where T : struct, IComparable, IFormattable, IConvertible, IComparable<T>, IEquatable<T>
    {
        public EntityDifference(string entityId, T value)
        {
            EntityId = entityId;
            Value = value;
        }

        public string EntityId { get; private set; }
        public T Value { get; private set; }
    }

    public class EntityDifferences<T>
        where T : struct, IComparable, IFormattable, IConvertible, IComparable<T>, IEquatable<T>
    {
        private readonly List<EntityDifference<T>> _values = new List<EntityDifference<T>>();

        public EntityDifferences(string entityId)
        {
            EntityId = entityId;
        }

        public string EntityId { get; private set; }
        public IEnumerable<EntityDifference<T>> Values
        {
            get { return _values; }
        }

        public void Add(EntityDifference<T> entityDifference)
        {
            _values.Add(entityDifference);
        }
    }
}